package com.mt.mall.service.good;

import com.mt.common.core.web.JsonResult;
import com.mt.common.core.web.base.PageDTO;
import com.mt.common.core.web.base.PageResultDTO;
import com.mt.mall.entity.good.ShoppingCart;

import java.util.List;

public interface ShoppingCartService {
    /**
     * 根据分页参数查询购物车集合
     *
     * @param pageDTO 分页条件
     */
    public PageResultDTO findShoppingCarts(PageDTO pageDTO);

    /**
     * 查询全部购物车集合
     *
     */
    public List<ShoppingCart> findAllShoppingCarts();

    /**
     * 根据名称查询购物车集合(只提取ID 和 Name)
     *
     * @param shoppingCartName 名称
     */
    public List<ShoppingCart> findShoppingCartsWithIdNameByName(String shoppingCartName);

    /**
     * 查询所有购物车集合(只提取ID 和 Name)
     *
     */
    public List<ShoppingCart> findAllShoppingCartsWithIdName();

    /**
     * 根据ID查询指定的购物车(只提取ID 和 Name)
     *
     * @param shoppingCartId Id
     */
    public ShoppingCart findShoppingCartsWithIdNameById(Long shoppingCartId);

    /**
     * 根据ID查询指定的购物车
     *
     * @param shoppingCartId Id
     */
    public ShoppingCart findShoppingCart(Long shoppingCartId);

    /**
     * 根据ID查询指定的购物车(包含外键)
     *
     * @param shoppingCartId Id
     */
    public ShoppingCart findShoppingCartWithForeignName(Long shoppingCartId);

    /**
     * 新增购物车
     *
     * @param shoppingCart 实体对象
     */
    public ShoppingCart saveShoppingCart(ShoppingCart shoppingCart);

    /**
     * 更新购物车
     *
     * @param shoppingCart 实体对象
     */
    public ShoppingCart updateShoppingCart(ShoppingCart shoppingCart);

    /**
     * 根据ID删除购物车
     *
     * @param shoppingCartId ID
     */
    public void deleteShoppingCart(Long shoppingCartId);

    ShoppingCart addShoppingCart(ShoppingCart shoppingCart);

    PageResultDTO findUserShoppingCarts(PageDTO pageDTO);

    void delShoppingCart(List<Long> shoppingCartIds);

    JsonResult updateCount(Long shoppingCartId, Integer count);

    JsonResult settlement(Long shoppingCartId);
}
